package com.violet.controller.app;

import com.violet.domain.result.Result;
import com.violet.domain.vo.app.UnProductVo;
import com.violet.service.app.AProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/product")
@RequiredArgsConstructor
public class AProductController {

    private final AProductService service;

    // 获取对应 IDS 的商品数据，查看是否为【stockOut、soldOut】
    @GetMapping("/unProduct")
    public Result<List<UnProductVo>> unProduct(@RequestParam List<String> ids) {
        return Result.success(service.getUnProducts(ids), "获取成功");
    }

}
